package com.element.security.exception;

import com.common.core.exception.code.SecurityErrorCode;
import org.springframework.security.oauth2.common.exceptions.ClientAuthenticationException;

/**
 * @auther WuJun.Zhang
 * @date 2022/7/12 上午11:51
 */
public class GlobalAuthenticationException extends ClientAuthenticationException {

    public GlobalAuthenticationException(String msg, Throwable t) {
        super(msg, t);
    }

    public GlobalAuthenticationException(String msg) {
        super(msg);
    }

    public int getHttpErrorCode() {
        return SecurityErrorCode.SYS_EXCEPTION_CODE.getErrNum();
    }

    public String getOAuth2ErrorCode() {
        return "sys_error";
    }
}
